<?php
/**
 * @desc 主题旅游
 * @author kevin.wang
 * @date 2015-01-01 12:00:00
 */
class theme extends CWidget
{    
	private $arr = array(
			'home' => "0, 1",
			'trip' => "0, 2"
		);
	private $limit = 24;
	private $_off = true;
    public function init()
    {
    }
 
    public function run()
    {
		if($this->_off){
			return false;
		}
		$name = Yii::app()->controller->id;
		$typeid = empty($this->arr[$name])?0:$this->arr[$name];
		$goods = new Goods();
		$categoryList = $goods->getCategory();
		$goodsList = $goods->getGoodsList($typeid,$this->limit);
		if(!empty($goodsList)){
			$goodsList = $goods->goodsCategory($goodsList, $categoryList);
		}
        $this->render('theme',array(
				'categoryList' => $categoryList,
				'goodsList' => $goodsList
			));
    }
}